/*
 * Rule.h
 *
 *  Created on: May 25, 2011
 *      Author: Stijn, Bart, Dave
 */

#ifndef RULE_H_
#define RULE_H_

#include <map>
#include <list>

#include "Command.h"

class Rule {
	private:
		std::map<Command*, int>* commands;
		bool isBackground;
		bool isChildProcess;
		int childPid;
	public:
		Rule();
		virtual ~Rule();

		void addCommand(Command*, int);
		void removeLastCommand();
		Command* getLastCommand();
		int getLastToken();
		bool hasCommands();
		void setBackground();
		bool execute();
		bool getIsChildProcess();
		bool getIsBackground();
		int getChildPid();
};

#endif /* RULE_H_ */
